/**
 * Created by Administrator on 2017/12/18 0018.
 */
define(['jquery','bbcare','scprit/patientsQuestionnaire/vm/common.js'],function($,$bb,$common){
    var servers = {};
    var URL = $bb.baseUrl("followup");
   // var URL = "http://192.168.1.108:18080/"
    /*
     * 保存签名：
     * */
    servers.toSaveSignature = function(params,callback,otherParams){
        $common.ajax({
            url: URL + "followup/webapi/service/sign/signature",
            data: JSON.stringify({
                "data": {
                    "evaluationType": "SIGN",
                    "channel": "BBCARE-APP",
                    "queueId": params.queueId,
                    "deptId": params.deptId,
                    "postionIds":{"url":params.imgUrl},
                    "userId": params.userId,
                    "postionScores": ""
                }
        }),
            success: function (data) {
                callback(data,otherParams)
            }
        });
    };
    /*
     * 图片上传：
     * */
    servers.upLoadSignature = function(params,callback,otherParams){
        $common.ajax({
            url: URL + "followup/webapi/service/sign/uploadSign",
            processData: false,  // 告诉jQuery不要去处理发送的数据
            contentType: false,
            data:params,
            success: function (data) {
                callback(data,otherParams)
            }
        });
    };
    /*
    * 查看签名照片：
    * */
    servers.toViewSignature = function(params,callback,otherParams){
        $common.ajax({
            url: /*URL +*/ "http://192.168.1.108:18080/followup/webapi/service/getImgFileSignUrl",
            data: JSON.stringify({
                "data": {
                    "channel": "BBCARE-APP",
                    "fileList":params.fileList
                }
            }),
            success: function (data) {
                callback(data,otherParams)
            }
        });
    };
    return servers;
});
